Integrand size = 23, antiderivative size = 76 \[ \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {a (a-2 b) \cot ^2(e+f x)}{2 f}-\frac {a^2 \cot ^4(e+f x)}{4 f}+\frac {(a-b)^2 \log (\cos (e+f x))}{f}+\frac {(a-b)^2 \log (\tan (e+f x))}{f} \]
1/2*a*(a-2*b)*cot(f*x+e)^2/f-1/4*a^2*cot(f*x+e)^4/f+(a-b)^2*ln(cos(f*x+e)) /f+(a-b)^2*ln(tan(f*x+e))/f
Time = 0.33 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.80 \[ \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {2 a (a-2 b) \cot ^2(e+f x)-a^2 \cot ^4(e+f x)+4 (a-b)^2 (\log (\cos (e+f x))+\log (\tan (e+f x)))}{4 f} \]
(2*a*(a - 2*b)*Cot[e + f*x]^2 - a^2*Cot[e + f*x]^4 + 4*(a - b)^2*(Log[Cos[ e + f*x]] + Log[Tan[e + f*x]]))/(4*f)
Time = 0.28 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.96, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4153, 354, 99, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \tan (e+f x)^2\right )^2}{\tan (e+f x)^5}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \frac {\int \frac {\cot ^5(e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 354 |
\(\displaystyle \frac {\int \frac {\cot ^3(e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\tan ^2(e+f x)+1}d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 99 |
\(\displaystyle \frac {\int \left (a^2 \cot ^3(e+f x)-a (a-2 b) \cot ^2(e+f x)+(a-b)^2 \cot (e+f x)-\frac {(a-b)^2}{\tan ^2(e+f x)+1}\right )d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\frac {1}{2} a^2 \cot ^2(e+f x)+a (a-2 b) \cot (e+f x)+(a-b)^2 \log \left (\tan ^2(e+f x)\right )-(a-b)^2 \log \left (\tan ^2(e+f x)+1\right )}{2 f}\) |
(a*(a - 2*b)*Cot[e + f*x] - (a^2*Cot[e + f*x]^2)/2 + (a - b)^2*Log[Tan[e + f*x]^2] - (a - b)^2*Log[1 + Tan[e + f*x]^2])/(2*f)
3.3.3.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) )^(p_), x_] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] && (IntegerQ[p] | | (GtQ[m, 0] && GeQ[n, -1]))
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S ymbol] :> Simp[1/2 Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x , x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ [(m - 1)/2]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Time = 0.16 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.91
method | result | size |
parallelrisch | \(\frac {-2 \left (a -b \right )^{2} \ln \left (\sec \left (f x +e \right )^{2}\right )+4 \left (a -b \right )^{2} \ln \left (\tan \left (f x +e \right )\right )-\cot \left (f x +e \right )^{2} a \left (\cot \left (f x +e \right )^{2} a -2 a +4 b \right )}{4 f}\) | \(69\) |
derivativedivides | \(\frac {\frac {\left (-a^{2}+2 a b -b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}-\frac {a^{2}}{4 \tan \left (f x +e \right )^{4}}+\left (a^{2}-2 a b +b^{2}\right ) \ln \left (\tan \left (f x +e \right )\right )+\frac {a \left (a -2 b \right )}{2 \tan \left (f x +e \right )^{2}}}{f}\) | \(82\) |
default | \(\frac {\frac {\left (-a^{2}+2 a b -b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}-\frac {a^{2}}{4 \tan \left (f x +e \right )^{4}}+\left (a^{2}-2 a b +b^{2}\right ) \ln \left (\tan \left (f x +e \right )\right )+\frac {a \left (a -2 b \right )}{2 \tan \left (f x +e \right )^{2}}}{f}\) | \(82\) |
norman | \(\frac {-\frac {a^{2}}{4 f}+\frac {a \left (a -2 b \right ) \tan \left (f x +e \right )^{2}}{2 f}}{\tan \left (f x +e \right )^{4}}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (\tan \left (f x +e \right )\right )}{f}-\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}\) | \(88\) |
risch | \(-i a^{2} x +2 i a b x -i b^{2} x -\frac {2 i a^{2} e}{f}+\frac {4 i a b e}{f}-\frac {2 i b^{2} e}{f}-\frac {4 a \left (a \,{\mathrm e}^{6 i \left (f x +e \right )}-b \,{\mathrm e}^{6 i \left (f x +e \right )}-a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 b \,{\mathrm e}^{4 i \left (f x +e \right )}+a \,{\mathrm e}^{2 i \left (f x +e \right )}-b \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{4}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}{f}-\frac {2 a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) b}{f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) b^{2}}{f}\) | \(198\) |
1/4*(-2*(a-b)^2*ln(sec(f*x+e)^2)+4*(a-b)^2*ln(tan(f*x+e))-cot(f*x+e)^2*a*( cot(f*x+e)^2*a-2*a+4*b))/f
Time = 0.28 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.30 \[ \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{4} + {\left (3 \, a^{2} - 4 \, a b\right )} \tan \left (f x + e\right )^{4} + 2 \, {\left (a^{2} - 2 \, a b\right )} \tan \left (f x + e\right )^{2} - a^{2}}{4 \, f \tan \left (f x + e\right )^{4}} \]
1/4*(2*(a^2 - 2*a*b + b^2)*log(tan(f*x + e)^2/(tan(f*x + e)^2 + 1))*tan(f* x + e)^4 + (3*a^2 - 4*a*b)*tan(f*x + e)^4 + 2*(a^2 - 2*a*b)*tan(f*x + e)^2 - a^2)/(f*tan(f*x + e)^4)
Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (63) = 126\).
Time = 3.27 (sec) , antiderivative size = 172, normalized size of antiderivative = 2.26 \[ \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\begin {cases} \tilde {\infty } a^{2} x & \text {for}\: e = 0 \wedge f = 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \cot ^{5}{\left (e \right )} & \text {for}\: f = 0 \\\tilde {\infty } a^{2} x & \text {for}\: e = - f x \\- \frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a^{2} \log {\left (\tan {\left (e + f x \right )} \right )}}{f} + \frac {a^{2}}{2 f \tan ^{2}{\left (e + f x \right )}} - \frac {a^{2}}{4 f \tan ^{4}{\left (e + f x \right )}} + \frac {a b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} - \frac {2 a b \log {\left (\tan {\left (e + f x \right )} \right )}}{f} - \frac {a b}{f \tan ^{2}{\left (e + f x \right )}} - \frac {b^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b^{2} \log {\left (\tan {\left (e + f x \right )} \right )}}{f} & \text {otherwise} \end {cases} \]
Piecewise((zoo*a**2*x, Eq(e, 0) & Eq(f, 0)), (x*(a + b*tan(e)**2)**2*cot(e )**5, Eq(f, 0)), (zoo*a**2*x, Eq(e, -f*x)), (-a**2*log(tan(e + f*x)**2 + 1 )/(2*f) + a**2*log(tan(e + f*x))/f + a**2/(2*f*tan(e + f*x)**2) - a**2/(4* f*tan(e + f*x)**4) + a*b*log(tan(e + f*x)**2 + 1)/f - 2*a*b*log(tan(e + f* x))/f - a*b/(f*tan(e + f*x)**2) - b**2*log(tan(e + f*x)**2 + 1)/(2*f) + b* *2*log(tan(e + f*x))/f, True))
Time = 0.23 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.80 \[ \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac {4 \, {\left (a^{2} - a b\right )} \sin \left (f x + e\right )^{2} - a^{2}}{\sin \left (f x + e\right )^{4}}}{4 \, f} \]
1/4*(2*(a^2 - 2*a*b + b^2)*log(sin(f*x + e)^2) + (4*(a^2 - a*b)*sin(f*x + e)^2 - a^2)/sin(f*x + e)^4)/f
Leaf count of result is larger than twice the leaf count of optimal. 293 vs. \(2 (72) = 144\).
Time = 1.35 (sec) , antiderivative size = 293, normalized size of antiderivative = 3.86 \[ \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {\frac {12 \, a^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {16 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 32 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right ) + 64 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right ) + \frac {{\left (a^{2} + \frac {12 \, a^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {16 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {48 \, a^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {96 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {48 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}}{64 \, f} \]
-1/64*(12*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 16*a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 32*(a^2 - 2*a*b + b^2)*log(abs(-cos(f*x + e) + 1)/abs(cos(f*x + e) + 1)) + 64*(a^2 - 2*a*b + b^2)*log(abs(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)) + (a^2 + 12*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 16*a*b*(cos(f* x + e) - 1)/(cos(f*x + e) + 1) + 48*a^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 96*a*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 48*b^2*(cos(f *x + e) - 1)^2/(cos(f*x + e) + 1)^2)*(cos(f*x + e) + 1)^2/(cos(f*x + e) - 1)^2)/f
Time = 12.24 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.20 \[ \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a^2-2\,a\,b+b^2\right )}{f}-\frac {\frac {a^2}{4}+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (a\,b-\frac {a^2}{2}\right )}{f\,{\mathrm {tan}\left (e+f\,x\right )}^4}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{f} \]